def read_file(filename):
    try:
        with open(filename,"r") as f:
            return f.read()
    except FileNotFoundError:
        return "找不到文件捏"
    
def count_lines(filename):
    try:
        with open(filename,"r") as f:
            lines = f.readlines()
            return len(lines)
    except FileNotFoundError:
        return "找不到文件捏"
    
if __name__ == "__main__":
    # print(read_file("poem.txt"))
    print(count_lines("poem,txt"))

